<div style="padding-bottom:5px;">
  <% 
     @rules.keys.each do |dependency|
       cls = Tr8n::Config.language_rule_dependencies[dependency] 
  %>
	    <div style="margin-bottom:10px; border-bottom: 1px dotted #ccc; padding-bottom:5px;">
	      <div class="tr8n_txtl" style="font-weight:bold; padding-bottom:5px; background-color:#f1f4fa; border:1px dotted #ccc; padding:5px;">
				  <%= tra("#{cls.dependency_label.capitalize} Rules")%>
				</div>
	      
				<div id="<%=dependency%>_rule_content" style="background-color:#eee; border:1px dotted #ccc; padding:5px;">
					<% if @rules[dependency].empty? %>
					  <div class="tr8n_txtl" style="font-style:italic; font-size: 10px; color: grey;">
					  	<%=tra("There are no #{cls.dependency_label} rules defined for this language.")%>
							<%=link_to_function(tra("Click here to add a new #{cls.dependency_label} rule."), "addLanguageRule('#{cls.dependency}', '0')")%>
					  </div>
					<% end %>
					
		      <% @rules[dependency].each_with_index do |rule, index| %>
					    <div style="padding-bottom:3px;">
							  <table> 
								  <tr>
								  	<td class="tr8n_txtl" style="vertical-align:middle;width:1%;white-space:nowrap;padding:3px;">
										  <%=link_to_function(image_tag("tr8n/add.png"), "addLanguageRule('#{dependency}','#{index+1}')")%>
			                <%=link_to_function(image_tag("tr8n/delete.png"), "deleteLanguageRule('#{dependency}','#{index}')")%>
										</td>	
								    <td class="tr8n_txtl" style="vertical-align:middle;text-align:left;">  
								      <% rule.definition ||= {} %>
								      
								      <%=hidden_field_tag("rules[#{dependency}][#{index}][id]", rule.id)%>
								      <%=hidden_field_tag("rules[#{dependency}][#{index}][reset_values]", "false", :id => "rule_#{index}_reset_values")%>
								      
                      <%=text_field_tag("rules[#{dependency}][#{index}][keyword]", rule.keyword, :style => "width:60px", :placeholder => "Keyword")%>

								      <%=render :partial=> "/tr8n/language/rules/#{dependency}_rule", :locals => {:rule => rule, :index => index} %>
                    </td>
                  </tr>
								</table>
					    </div>
		      <% end %>
				</div>	 
      </div>
  <% end %> 
</div>

<div class="tr8n_txtl" style="color:grey; font-size:10px; padding-top:5px; padding-bottom:5px;">
  <%=tra("For numeric rules, you can enter multiple values seprated by commas.")%>
</div>
